package org.example.tools;

import java.util.Random;

public class RandReviewTool {

    public void randQuestion(int total, int pagesize, int target) {
        Random random = new Random();
        for (int i=1;i<=target;i++) {
            int randomInt = random.nextInt(total);
            System.out.printf("复习题目第%d页，第%d题\n", randomInt / pagesize + 1, randomInt % pagesize + 1);
        }
    }

    public static void main(String[] args) {
        int total = 21;
        int pageSize = 50;
        int target = 3;
        RandReviewTool randReviewTool = new RandReviewTool();
        randReviewTool.randQuestion(total, pageSize, target);
    }
}
